#include <stdio.h>
#include <math.h>

int main()
{
    int len = 1, vec[len], sum = 0;
    printf("Input the vector length: ");
    scanf("%d", &len);

    printf("Input the vector: ");
    for (int i = 0; i < len; i++) {
        scanf(" %d", &vec[i]);
        sum += vec[i];
    }
    
    int result = 0;
    for (int i = 0; i < len; i++) 
        for (int j = 0; j < len; j++) 
            if (i != j) 
                result += vec[j] * 10 + vec[i];
    
    printf("Sum = %d\n", result);

    return 0;
}